﻿package  {
	
	import flash.display.*;
	
	
	import com.cenfun.ui.*;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class UIC extends MovieClip {
		
		
		public function UIC() {
			
			addButton();

			addScrollPane();
		}
	
		private function addButton():void {
			var bt:BT = new BT(Button_upSkin, Button_overSkin, Button_downSkin);
			bt.name = "bt";
			bt.autoRepeat = true;
			bt.addEventListener(BT.BUTTON_DOWN, btclick);
			addChild(bt);

			bt.move(10, 10);
			//bt.size(200, 30);
			
			var bt1:BT = new BT(Button_upSkin, Button_overSkin, Button_downSkin);
			bt1.autoRepeat = true;
			bt1.addEventListener(BT.BUTTON_DOWN, btclick);
			addChild(bt1);

			bt1.move(10, 40);
			/*
			var skins:Object = {
				up : Button_upSkin,
				over : Button_overSkin,
				down : Button_downSkin
			};
			bt.style(skins);
			*/
		}
		
		
		private function btclick(e:UE):void {
			if (e.currentTarget.name == "bt") {
				child.height -= child.height * 0.02;
				
			} else {
				child.height += child.height * 0.02;
			}
			sp.update();
		}
		
		private var sp:SP;
		private var child:DisplayObject;
		private function addScrollPane():void {
			sp = new SP();
			
			addChild(sp);
			
			sp.move(100, 10);
			sp.size(600, 500);
			
			child = new IMG();
			
			sp.content = child;
			
		}
		
	}
}
